home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / AppleTalk Remote access / Scripts ARA ƒ / EMAC MD9600 < prev    next >
Encoding:
Text File  |  1991-12-17  |  2.6 KB  |  177 lines  |  [mlts/slnk]

  1. ! "EMAC MD9600 (hacked) — 19.8.91 scs"
  2. !
  3. @ORIGINATE
  4. @ANSWER
  5. !
  6. @LABEL 1
  7. serreset 9600, 0, 8, 1
  8. matchclr
  9. settries 0
  10. !
  11. ! first recall the factory configuration
  12. !
  13. @LABEL 2
  14. matchstr 1 3 "OK\13\10"
  15. write "AT&F\13"
  16. matchread 20
  17. inctries
  18. iftries 2 59
  19. ! Modem is not responding, reset
  20. DTRClear
  21. pause 5
  22. DTRSet
  23. jump 1
  24. !
  25. ! Next, Set up the configuration: turn off echo, disable error correction,
  26. ! disable flow control, enable xon/xoff pass through
  27. !
  28. @LABEL 3
  29. matchstr 1 4 "OK\13\10"
  30. write "ATE0\\N0\\Q0\\X1\13"
  31. matchread 30
  32. jump 59
  33. !
  34. ! Reset the modem when DTR drops
  35. !
  36. @LABEL 4
  37. matchstr 1 5 "OK\13\10"
  38. write "AT&D3\13"
  39. matchread 30
  40. jump 59
  41. !
  42. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  43. @LABEL 5
  44. ifstr 2 8 "1"
  45. matchstr 1 8 "OK\13\10"
  46. write "ATM0\13"
  47. matchread 30
  48. jump 59
  49. !
  50. ! The modem is ready.  So enable answering, or originate a call
  51. !
  52. @LABEL 8
  53. ifANSWER 13
  54. note "Dialing ^1" 3
  55. write "ATS0=0DT^1\13"
  56. !
  57. @LABEL 9
  58. matchstr 1 11 "CONNECT 4800\13\10"
  59. matchstr 2 12 "CONNECT 9600\13\10"
  60. matchstr 3 50 "NO CARRIER\13\10"
  61. matchstr 4 50 "ERROR\13\10"
  62. matchstr 5 52 "NO DIALTONE\13\10"
  63. matchstr 6 53 "BUSY\13\10"
  64. matchstr 7 54 "NO ANSWER\13\10"
  65. matchread 700
  66. jump 59
  67. !
  68. @LABEL 11
  69. note "Communicating at 4800 bps" 2
  70. setspeed 4800
  71. jump 15
  72. !
  73. @LABEL 12
  74. note "Communicating at 9600 bps" 2
  75. !
  76. @LABEL 15
  77. ifANSWER 18
  78. pause 30
  79. @LABEL 18
  80. exit 0
  81. !
  82. ! @ANSWER
  83. ! Set up the modem to answer
  84. !
  85. @LABEL 13
  86. write "ATS0=1\13"
  87. matchstr 1 14 "OK\13\10"
  88. matchread 30
  89. jump 59
  90. !
  91. @LABEL 14
  92. matchstr 1 20 "RING\13\10"
  93. matchstr 2 11 "CONNECT 4800\13\10"
  94. matchstr 3 12 "CONNECT 9600\13\10"
  95. matchstr 4 50 "NO CARRIER\13\10"
  96. matchstr 5 50 "ERROR\13\10"
  97. matchstr 6 52 "NO DIALTONE\13\10"
  98. matchstr 7 53 "BUSY\13\10"
  99. matchstr 8 54 "NO ANSWER\13\10"
  100. matchread 700
  101. jump 14
  102. !
  103. @LABEL 20
  104. userhook 1
  105. note "Answering phone…" 2
  106. jump 14
  107. !
  108. ! 50: error messages
  109. !
  110. @LABEL 50
  111. exit -6021
  112. !
  113. @LABEL 52
  114. exit -6020
  115. !
  116. @LABEL 53
  117. exit -6022
  118. !
  119. @LABEL 54
  120. exit -6023
  121. !
  122. @LABEL 59
  123. exit -6019
  124. !
  125. ! Hang up the modem
  126. !
  127. @HANGUP
  128. @LABEL 60
  129. settries 0
  130. @LABEL 61
  131. matchclr
  132. write "ATH0\13"
  133. matchstr 1 64 "OK\13\10"
  134. matchstr 2 63 "NO CARRIER\13\10"
  135. matchstr 3 64 "ERROR\13\10"
  136. matchread 30
  137. inctries
  138. iftries 3 63
  139. ! no response, try escape sequence
  140. write "+++"
  141. matchclr
  142. matchstr 1 62 "OK\13\10"
  143. matchread 15
  144. ! still no response, toggle DTR
  145. DTRClear
  146. pause 10
  147. DTRSet
  148. jump 61
  149. !
  150. @LABEL 62
  151. pause 5
  152. matchstr 1 64 "OK\13\10"
  153. matchstr 2 63 "NO CARRIER\13\10"
  154. write "ATH0\13"
  155. matchread 60
  156. jump 61
  157. !
  158. @LABEL 63
  159. pause 45
  160. Flush
  161. !
  162. ! Recall the factory settings
  163. !
  164. @LABEL 64
  165. matchclr
  166. matchstr 1 65 "OK\13\10"
  167. write "AT&F\13"
  168. matchread 30
  169. !
  170. @LABEL 65
  171. matchstr 1 66 "OK\13\10"
  172. write "ATS0=0\13"
  173. matchread 30
  174. !
  175. @LABEL 66
  176. exit 0
  177.